package com.wang.service;

import com.wang.config.FeignConfiguration;
import com.wang.pojo.Dept;
import org.springframework.cloud.openfeign.FeignAutoConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List;

/**
 * @Author: along
 * @Create: 2021/6/7
 * @Description:
 */
@FeignClient(value = "SPRINGCLOUD-PROVIDER", fallbackFactory = DeptClientServiceFactory.class, configuration = FeignConfiguration.class)
@Component
public interface DeptClientService {
    @RequestMapping("/dept/list")
    public List<Dept> queryAll();

    @RequestMapping("/dept/get/{id}")
    public Dept queryById(@PathVariable("id") Long id);

    @RequestMapping("/dept/add")
    public boolean addDept(Dept dept);
}
